home *** CD-ROM | disk | FTP | other *** search
/ Qoole for Quake / Qoole for Quake (USA) / Qoole for Quake (USA).bin / Tutorial / HTML / QUBE.ZIP / SRC / CMDLIB.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-05  |  1.6 KB  |  73 lines

  1. /* cmdlib.h*/
  2.  
  3. #ifndef __CMDLIB__
  4. #define __CMDLIB__
  5.  
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #include <errno.h>
  10. #include <ctype.h>
  11. #include <time.h>
  12. #include <stdarg.h>
  13.  
  14. #ifndef __BYTEBOOL__
  15. #define __BYTEBOOL__
  16. typedef enum {false, true} qboolean;
  17. typedef unsigned char byte;
  18. #endif
  19.  
  20. /* the dec offsetof macro doesn't work very well... */
  21. #define myoffsetof(type,identifier) ((size_t)&((type *)0)->identifier)
  22.  
  23.  
  24. /* set these before calling CheckParm */
  25. extern int myargc;
  26. extern char **myargv;
  27.  
  28. char *strupr (char *in);
  29. char *strlower (char *in);
  30. int Q_strncasecmp (char *s1, char *s2, int n);
  31. int Q_strcasecmp (char *s1, char *s2);
  32.  
  33. int filelength (FILE *f);
  34.  
  35. double I_FloatTime (void);
  36.  
  37. void    Error (char *error, ...);
  38. int        CheckParm (char *check);
  39.  
  40. FILE    *SafeOpenWrite (char *filename);
  41. FILE    *SafeOpenRead (char *filename);
  42. void    SafeRead (FILE *f, void *buffer, int count);
  43. void    SafeWrite (FILE *f, void *buffer, int count);
  44.  
  45. int        LoadFile (char *filename, void **bufferptr);
  46. void    SaveFile (char *filename, void *buffer, int count);
  47.  
  48. void     DefaultExtension (char *path, char *extension);
  49. void     DefaultPath (char *path, char *basepath);
  50. void     StripFilename (char *path);
  51. void     StripExtension (char *path);
  52.  
  53. void     ExtractFilePath (char *path, char *dest);
  54. void     ExtractFileBase (char *path, char *dest);
  55. void    ExtractFileExtension (char *path, char *dest);
  56.  
  57. int     ParseNum (char *str);
  58.  
  59. short    BigShort (short l);
  60. short    LittleShort (short l);
  61. int        BigLong (int l);
  62. int        LittleLong (int l);
  63. float    BigFloat (float l);
  64. float    LittleFloat (float l);
  65.  
  66.  
  67. char *COM_Parse (char *data);
  68.  
  69. extern    char        com_token[1024];
  70. extern    qboolean    com_eof;
  71.  
  72. #endif
  73.